package cobersky.skinUI.skins.graphics
{
	import flash.display.CapsStyle;
	import flash.display.JointStyle;
	import flash.display.LineScaleMode;
	import flash.display.Shape;
	import flash.geom.Rectangle;

	public class Rect extends Shape
	{
		public function Rect(w:Number=80,h:Number=30,fillColor:uint=0xdddddd,fillAlpha:Number=1,lineThick:Number=0,lineColor:uint=0,lineAlpha:Number=1,topLeftCorner:Number=0,topRightCorner:Number=0,bottomLeftCorner:Number=0,bottomRightCorner:Number=0){
			lineAlpha&&graphics.lineStyle(lineThick,lineColor,lineAlpha,true);
			graphics.beginFill(fillColor,fillAlpha);
			(topLeftCorner||topRightCorner||bottomLeftCorner||bottomRightCorner)?graphics.drawRoundRectComplex(0,0,w,h,topLeftCorner,topRightCorner,bottomLeftCorner,bottomRightCorner):graphics.drawRect(0,0,w,h);
			graphics.endFill();
			const xx:Number=Math.max(topLeftCorner,topRightCorner,bottomLeftCorner,bottomRightCorner);
			if(xx)this.scale9Grid=new Rectangle(xx,xx,w-xx*2,h-xx*2);
			this.cacheAsBitmap=true;
		}
	}
}